﻿using System.Windows;

namespace ListView_binding {
  public partial class MainWindow : Window {
    public MainWindow() {
      InitializeComponent();
      DataContext = data_;
    }
    private BindData data_ = new BindData();

    private void add_Click(object sender, RoutedEventArgs e)
    {
        data_.addPair(txtName.Text, txtContact.Text);
    }

    private void remove_Click(object sender, RoutedEventArgs e)
    {
        data_.remove_at(lstEntry.SelectedIndex);
    }

  }
}
